import {permissionDetail} from '@/services/permission'

export default  {
  namespace: 'permission',
  state: {
    permission: []
  },
  effects: {
    *fetchPermission({payload},{call,put}) {
      const response = yield call(permissionDetail,payload)
      // console.log(response)
      yield put({
        type: 'PermissionData',
        payload: response,
      })
    }
  },
  reducers: {
    PermissionData(state,action) {
      return {
        ...state,
        permission: action.payload
      }
    }
  }
}
